package adapletplugin.editors;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.ui.forms.editor.FormEditor;

import adapletplugin.editors.pages.MapFileHeaderPage;
import adapletplugin.editors.pages.MapFileInterfacePage;
import adapletplugin.editors.pages.MapFileReferenceTypePage;
import adapletplugin.editors.pages.MapFileRelToRelPage;
import adapletplugin.editors.pages.MapFileRelationshipPage;
import adapletplugin.editors.pages.MapFileTablePage;
import adapletplugin.editors.pages.MapFileTypePage;
import adapletplugin.editors.pages.MapFileViewPage;

public class MapFileEditor extends FormEditor
{
	public static final String ID = "org.AdapletPlugin.editors.MapFileEditor";

	private MapFileViewPage fViewPage;

	@Override
	protected void addPages()
	{
		setPartName("Map File Editor");

		try
		{
			// addPage(new MapFileEditorPage(this, "Page1",
			// "Map File Editor Page"));

			addPage(new MapFileHeaderPage(this));
			addPage(new MapFileTablePage(this));
			addPage(new MapFileTypePage(this));
			addPage(new MapFileReferenceTypePage(this));
			addPage(new MapFileRelationshipPage(this));
			addPage(new MapFileRelToRelPage(this));
			addPage(new MapFileInterfacePage(this));

			fViewPage = new MapFileViewPage(this);

			addPage(fViewPage);
		} catch (Exception e)
		{
			e.printStackTrace();
		}

	}

	@Override
	public void doSave(IProgressMonitor monitor)
	{
		// TODO Auto-generated method stub

	}

	@Override
	public void doSaveAs()
	{
		// TODO Auto-generated method stub

	}

	@Override
	public boolean isSaveAsAllowed()
	{
		// TODO Auto-generated method stub
		return false;
	}

	public void refresh()
	{
		fViewPage.refresh();

	}

}
